<template>
	<view class="content">
		<text class="freeOrdrMaster">{{ data.name }}</text>
		<text class="mailbox" @click="mailbox">邮箱：{{ data.email }}</text>
		<text class="phnn" @click="dialNumber">
			微信客服：{{ data.service }}
		</text>
		<image :src="data.code" mode="" class="qrCd" @click="saveImage"></image>
		
	</view>
</template>

<script>
export default {
	
	
	
	data() {
		return {
			data: {}
		};
	},
	methods: {
		// 保存图片
		saveImage(e) {
			wx.previewImage({
			  current: this.data.code, // 当前显示图片的http链接
			  urls: [this.data.code] // 需要预览的图片http链接列表
			})
		},
		//获取联系我们
		async getInTouch() {
			const { data: res } = await this.$u.post('api/users/user_contact');
			console.log('res >>  ', res);
			this.data = res;
		},
		dialNumber() {
			uni.makePhoneCall({
				phoneNumber: this.data.service
			});
		},
		mailbox() {
			uni.setClipboardData({
				data: this.data.email,
				success: function() {
					console.log('success');
				}
			});
		}
	},
	onLoad() {
		this.getInTouch();
	}
};
</script>

<style lang="scss" scoped>
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	.freeOrdrMaster {
		display: block;
		margin: 0 auto;
		margin-top: 218rpx;
		height: 47rpx;
		font-size: 48rpx;
		font-family: ZhenyanGB;
		font-weight: 400;
		color: #333333;
	}

	.mailbox {
		display: block;
		margin: 0 auto;
		height: 33rpx;
		font-size: 34rpx;
		font-family: 'Microsoft YaHei', PingFang SC;
		font-weight: 400;
		color: #333333;
		margin-top: 39rpx;
	}

	.phnn {
		margin: 0 auto;
		display: block;
		height: 33rpx;
		font-size: 34rpx;
		font-family: 'Microsoft YaHei', PingFang SC;
		font-weight: 400;
		color: #333333;
		margin-top: 21rpx;
		// margin-left: 174rpx;
	}

	.qrCd {
		display: block;
		margin: 0 auto;
		width: 271rpx;
		height: 270rpx;
		// background-color: pink;
		margin-top: 101rpx;
		text-align: center;
		line-height: 270rpx;
	}
}
</style>
